import React    from 'react';
import ReactDOM from 'react-dom';

import MyDateRange  from './myDateRange.js';

var CommentBox = React.createClass({
  getInitialState () {
    return {
      startDate: '',
      endDate: '',
    }
  },

   componentWillMount (){

   },

    onscallback(_date) {
        if (!!_date) {
          this.state.startDate = _date.startTime || _date.startDate;
          this.state.endDate = _date.endDate || _date.endTime;
        }

    },
  

    render: function() {
    return (
      <div className="commentBox">      
      <MyDateRange onscallback={this.onscallback}></MyDateRange>
      </div>
    );
    }
});

ReactDOM.render(
    <CommentBox />,
    document.getElementById('app')
);
